/**
 * @filename:PickMaterialService Dec 15, 2023
 * @project Wonder Vue Admin Api  1.1.0
 * Copyright(c) 2022 Wonder Co. Ltd. 
 * All right reserved. 
 */
package com.wonder.app.service;
import cn.hutool.json.JSONObject;
import com.vtuzx.core.bean.dto.VtuzxMap;
import com.wonder.app.domain.PickMaterial;
import com.wonder.app.domain.PickMaterialDetail;
import com.wonder.app.request.PickMaterialRequest;
import com.wonder.common.common.AjaxResult;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;
import java.util.Map;
/**   
 * @Description:TODO(生产领料单服务层)
 * @version: 1.1.0
 * @author: Wonder
 * 
 */
public interface PickMaterialService extends IService<PickMaterial> {

    
    /**
     * 验证生产领料单信息
     * 
     * @param pickMaterial
     * @param type
     * @return 结果
     */
    public String validate(PickMaterial pickMaterial,String type);   
   
	
	 /**
	 * Description:生产领料单分页返回
	 * @param request//检索条件
	 * @param page//分页参数
	 * @return IPage<PickMaterial>   //分页记录
	 */
    public IPage<PickMaterial> selectList(PickMaterialRequest request, Page<PickMaterial> page);


	/**
	 * 查询生产;领料单详情
	 * @param
	 * @return
	 */
	VtuzxMap getDetail(String id);

	/**
	 *反审生产领料单
	 * @param userName
	 * @param id
	 * @return
	 */
    boolean unAuditPickMaterial(Long userId,String userName, String billNo)throws Exception;

	/**
	 * 审核生产领料单
	 * @param userName
	 * @param id
	 * @return
	 */
	boolean auditPickMaterial(Long userId,String userName, String billNo) throws Exception;

	/**
	 * 获取领料单对应的用料清单
	 * @param taskBillNo
	 * @return
	 */
	VtuzxMap getPickPpbom(String taskBillNo);

	/**
	 * 根据用料清单重新生成领料单
	 * @param user_id
	 * @param userName
	 * @param dataList
	 * @return
	 */
	VtuzxMap changePickMaterial(Long user_id, String userName,Map<String,Object> header, List<Map<String, Object>> dataList);

	/**
	 * 保存领料详情
	 * @param dataList
	 * @return
	 */
	boolean savePickDetail( String userName,Map<String,Object> header, List<Map<String,Object>> dataList);

	/**
	 * 生成领料单
	 * @param map
	 * @return
	 */
    Boolean savePickMaterialPad(JSONObject map);
}
